home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8" ?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <xsl:output method="html" indent="yes" />
- <xsl:key name="keyExe" match="Event [App and Action]" use="App" />
- <xsl:key name="keyAction" match="Event [App and Action]" use="Action/@fnc" />
- <xsl:key name="keyExeAction" match="Event [App and Action]" use="concat (App, ' ', Action/@fnc)" />
-
- <xsl:variable name="Def" select="document('FncIds.xml ')"/>
-
- <xsl:template match="/">
- <html>
- <head>
- <title>Events by EXE</title>
- <style type="text/css">
- table
- { border-collapse: collapse;
- width: 90%;
- table-layout: fixed;
- border-style: solid;
- }
- table, td
- { border-width: 1px;
- }
- td
- { color: black;
- font-family: Arial;
- font-size: x-small;
- border-right-style: none;
- border-left-style: none;
- border-top-style: solid;
- border-bottom-style: solid;
- }
- .DarkBack
- { background-color: #0066FF;
- background-color: blue;
-
- color: white;
- font-weight: bold;
- }
- .LightBack
- { background-color: #99CCFF;
- color: black;
- }
- .RightJustified
- { text-align: right;
- }
-
- </style>
- </head>
- <body>
- <h3>Events by EXE</h3>
- <!--
- <xsl:for-each select="//Event[generate-id() = generate-id(key('keyExe', App)[1])]">
- <xsl:value-of select="App" />
- <br />
- </xsl:for-each>
- <br/>
- <hr/>
- <br />
- <xsl:for-each select="//Event[generate-id() = generate-id(key('keyAction', Action/@fnc)[1])]">
- <xsl:value-of select="Action/@fnc" />
- <br />
- </xsl:for-each>
- <hr />
- -->
- <hr />
- <table>
- <!-- Process each Exe -->
- <xsl:for-each select="//Event[generate-id(.) = generate-id(key('keyExe', App)[1])]">
- <xsl:variable name="strAppID">
- <xsl:value-of select="App" />
- </xsl:variable>
- <!-- Select all the Employees belonging to the Team -->
- <xsl:variable name="lstEvent" select="//Event[App=$strAppID]" />
- <!-- Show details for Employees in Team -->
- <xsl:call-template name="ShowEmployeesInTeam">
- <xsl:with-param name="lstEvent" select="$lstEvent" />
- </xsl:call-template>
- </xsl:for-each>
- <tr>
- <td colspan="4" class="RightJustified DarkBack">Grand Total</td>
- <td colspan="1" class="RightJustified DarkBack">
- <!-- Show Grand Total of hours for all Employees -->
- <xsl:value-of select="count(//Event)" />
- </td>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="ShowEmployeesInTeam">
- <xsl:param name="lstEvent" />
- <!-- Show the name of the Team currently being processed -->
- <tr>
- <td colspan="4" class="DarkBack">EXE: <xsl:value-of select="$lstEvent[1]/App" />
- </td>
- <td colspan="1" class="DarkBack RightJustified">EVENTS</td>
- </tr>
- <!-- Show the total hours for each Employee in the Team -->
- <xsl:for-each select="$lstEvent[generate-id() = generate-id(key('keyExeAction', concat (App, ' ', Action/@fnc))[1])]">
- <xsl:variable name="lngActionFnc" select="Action/@fnc" />
- <!-- Show details of each Employee -->
- <tr>
- <td colspan="4">
- <!--<xsl:value-of select="$lstEmployee[EmployeeID=$lngEmployeeID]/Name"/>
- <xsl:value-of select="$lstEmployee[EmployeeID=$lngEmployeeID]/Surname"/>
- -->
- Action:
- <xsl:value-of select="$Def//Fnc[@id_dec=$lngActionFnc]" /> (<xsl:value-of select="$lngActionFnc" />)
- </td>
- <td colspan="1" class="RightJustified">
- <!-- Show the total hours for the current Employee -->
- <xsl:value-of select="count($lstEvent[ Action/@fnc=$lngActionFnc])" />
- </td>
- </tr>
- </xsl:for-each>
- <tr>
- <td colspan="4" class="LightBack RightJustified">Sub-Total</td>
- <td colspan="1" class="LightBack RightJustified">
- <!-- Show the total hours for all Employees in the Team -->
- <xsl:value-of select="count($lstEvent)" />
- </td>
- </tr>
- </xsl:template>
- </xsl:stylesheet>
-